package com.xdcplus.web.mapper.device;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.xdcplus.mom.pojo.vo.DeviceFixRecordVO;
import com.xdcplus.mom.pojo.vo.DevicePmRecordVO;
import com.xdcplus.web.common.datasource.Epm;
import com.xdcplus.web.common.datasource.EpmMysql;
import com.xdcplus.web.common.pojo.dto.device.DevicePerformanceFilterDTO;
import com.xdcplus.web.common.pojo.vo.device.DeviceFaultDetailVO;
import com.xdcplus.web.common.pojo.vo.device.DeviceStatusDurationVO;
import com.xdcplus.web.common.pojo.vo.device.EpmUserVO;
import com.xdcplus.web.common.pojo.vo.device.ToolProduceVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author Richard.Li
 */

public interface DevicePerformanceMapper {

    @Epm
    List<DeviceStatusDurationVO> queryDeviceStatusDurations(DevicePerformanceFilterDTO devicePerformanceFilterDTO);

    List<ToolProduceVO> queryProdCount(DevicePerformanceFilterDTO devicePerformanceFilterDTO);

    @Epm
    List<DeviceFaultDetailVO> queryOrderDetail(DevicePerformanceFilterDTO devicePerformanceFilterDTO);

    @Epm
    List<DeviceFaultDetailVO> queryDeviceFaultDetail(DevicePerformanceFilterDTO devicePerformanceFilterDTO);

    @EpmMysql
    String queryDeptNameByDeptId(@Param("deptId") String deptId);

    /**
     * 1.按维修单据查询
     * 2. 按设备异常单查询（临时业务需求）
     * @param toolCode
     * @param startShiftDate
     * @param endShiftDate
     * @return
     */
    @Epm
    String queryRepairTimeByDevice(@Param("toolCode") String toolCode,
                                   @Param("startShiftDate") String startShiftDate,
                                   @Param("endShiftDate") String endShiftDate);


    @Epm
    List<DevicePmRecordVO> queryPmRecord(@Param("startDate") String startDate, @Param("endDate") String endDate);

    @EpmMysql
    List<EpmUserVO> queryUserList();

    @Epm
    List<DeviceFixRecordVO> queryFixRecord(@Param("startDate") String startDate, @Param("endDate") String endDate);
}
